package work1;

import java.util.Scanner;

public class Work11 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入数组长度");
        int length=scanner.nextInt();
        int []a=new int[length];
        System.out.println("请输入数组元素");
        for (int i=0;i<length;i++){
            a[i]=scanner.nextInt();
        }
        q(a);
    }
    public static void q(int[] arr) {
        int i=0;
        int j=arr.length-1;
        while (i<j){
            int temp=arr[i];
            arr[i]=arr[j];
            arr[j]=temp;
            i++;
            j--;
        }
        for (int f=0;f<arr.length;f++){
            System.out.println(arr[f]);
        }
    }
}
